<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateAdminsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('admins', function (Blueprint $table) {
            $table->increments('id')->comment('用户标识');
            $table->string('email',50)->unique()->nullable()->comment('email');
            $table->string('username',50)->unique()->nullable()->comment("用户名");
            $table->string('password')->comment('登录密码');
            $table->string('login_ip')->nullable()->comment('最后登录ip');
            $table->integer('login_time')->nullable()->comment('最后登录时间');
            $table->integer('login_count')->default(0)->comment('最后登录时间');
            $table->integer('status')->default(0)->comment('用户状态，0：锁定，1:正常');
            $table->rememberToken();
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::drop('admins');
    }
}
